<template>
  <div>
    <p>home</p>

    <button @click="increment">count:{{ count }};double:{{ double }}</button>
  </div>
</template>

<script setup lang="ts">
import { storeToRefs } from 'pinia'
import { useCounterStore } from '../store/counter'
import request from '../utils/request';

const counter = useCounterStore()

const { count, double } = storeToRefs(counter) //这样才是响应式的
const { increment } = counter

request('/api/getNewsList').then((res) => {
  console.log(res)
  // to do...
})
</script>

<style scoped></style>
